from player.AlphaZeroPlayer import MCTSPlayer
from player.RandomPlayer import RandomPlayer
from player.base.player import Player


class ComparePlayer(Player):
    index = 0

    def __init__(self, ai_board):
        self.player1 = RandomPlayer()
        self.player2 = MCTSPlayer(ai_board)

    def step(self, board, pos, code, error_pos) -> (int, int):

        if self.index < 3:
            step = self.player1.step(board, pos, code, error_pos)
        else:
            step = self.player2.step(board, pos, code, error_pos)

        self.index += 1
        return step
